<!-- 页面 -->
<template>
	<s-layout-pc navbar="none">
		<view class="myduihuan">
			<view class="vasp-box uni-padding-wrap uni-common-mt uni-border">
				<view class="vasp_title" v-for="item in state.vasp_data" @tap="golist(item.RelationId)">
					<view>{{item.ordertitle}}</view>
					<view class='baoinfo'>
						<view>兑换日期：{{timeSubstring(item.orderdate)}}</view>
						<view>产品有效期：{{timeSubstring(item.deadline_time)}}</view>
					</view>
				</view>
			</view>
		</view>
	</s-layout-pc>
</template>

<script setup>
	import {
		computed,
		reactive
	} from 'vue';
	import {
		onLoad,
	} from '@dcloudio/uni-app';
	import sheep from '@/sheep';
	import SLayoutPc from '@/sheep/components/s-layout-pc/s-layout-pc.vue';



	// 数据
	const state = reactive({
		loadStatus: '',
		vasp_data: []

	});

	//wxw
	function golist(orderid) {
		sheep.$router.go('/pages/index/user', {
			'path': 'vasplist',
			'RelationId': orderid,
		});
	}

	function navigateTo(path) {
		sheep.$router.go(path);
	}



	function getmyzengzhibao() {
		sheep.$api.dhzengzhi.get_my_zengzhibaocon().then((res) => {
			state.vasp_data = res.data;
		});
	}

	onLoad(async (options) => {
		//console.log(state.filterData);
		sheep.$store('user').getInfo()
			.then((resinfo) => {
				if (resinfo === undefined) {
					return;
				} else {
					getmyzengzhibao();
				}

			});
		//showAuthModal('accountLogin');
	});
	
	function timeSubstring(timestr){
		return timestr.match(/^\d{4}-\d{2}-\d{2}/)[0]
	}
</script>

<style lang="scss" scoped>
	.myduihuan {
			background: #ffffff !important;
		}
	
		.channel-title-box {
			display: flex;
			align-items: flex-start;
		}
	
		.channel-title {
			font-size: 20px;
			font-weight: bold;
			margin-bottom: 50px;
			flex: 1 1 auto !important;
		}
	
		.btn-back {
			background: #e9b665;
			margin-bottom: 20px;
			border-radius: 20px;
		}
	
		.btn-dh {
			background: #ff5160;
			margin-bottom: 20px;
			border-radius: 5px;
			font-size: 16px;
		}
	
		.page-tiele-kc {
			text-align: center;
			line-height: 48rpx;
			font-size: 38rpx;
			font-weight: bold;
		}
	
		.uni-common-mt {
			margin-top: 15px
		}
	
		.uni-padding-wrap {
			padding: 0 15px;
		}
	
		.vasp-box {
			min-height: 400px;
			margin: 0;
			margin-top: 10px;
			/* margin: 0 15px; */
			/* background: url('static/images/7.png') center top no-repeat !important; */
		}
	
		.vasp_title {
			font-size: 1rem;
			line-height: 1.9375rem;
			color: #333;
			padding: 10px;
			font-weight: normal;
			cursor: pointer;
			border-bottom: 1px solid #e1e1e1;
			padding: 20px 10px;
		}
	
		.baoinfo {
			display: flex;
			justify-content: flex-start;
			font-size: 14px;
			color: #666666;
			margin-top: 25px;
		}
		
		.baoinfo view{width:260px;}
	
		.vasp_title:hover {
			background-color: #f6f6f6;
			cursor: pointer;
		}
	
		.vasp_con {
			background-color: #fffbf1;
			color: #753c12;
			text-align: center;
			line-height: 58rpx;
			font-size: 30rpx;
			padding: 20px;
			border-radius: 0 0 7px 7px;
		}
	
		.buy-box {
			position: absolute;
			bottom: 0rpx;
			right: 20rpx;
			z-index: 2;
			width: 120rpx;
			height: 50rpx;
			background: linear-gradient(90deg, #fe8900, #ff5e00);
			border-radius: 25rpx;
			font-size: 24rpx;
			color: #ffffff;
		}
	
		.price-unit {
			margin-right: -4px;
			color: red;
			font-size: 36rpx;
		}
	
		.ss-order-card-warp {
			padding: 20rpx;
	
			.img-box {
				width: 184rpx;
				height: auto;
				border-radius: 10rpx;
				overflow: hidden;
	
				.order-img {
					width: 184rpx;
					height: auto;
				}
			}
	
			.box-right {
				flex: 1;
				position: relative;
			}
	
			.title-text {
				font-size: 30rpx;
				font-weight: 500;
				line-height: 40rpx;
			}
		}
	
		:deep(.uni-tooltip-popup) {
			background: var(--ui-BG);
		}
	
		.warning-color {
			color: #faad14;
		}
	
		.danger-color {
			color: #ff3000;
		}
	
		.success-color {
			color: #52c41a;
		}
	
		.info-color {
			color: #999999;
		}
</style>